{
 "cells": [
  {
   "cell_type": "code",
   "id": "initial_id",
   "metadata": {
    "collapsed": true,
    "ExecuteTime": {
     "end_time": "2025-11-11T09:18:10.733010Z",
     "start_time": "2025-11-11T09:18:10.726171Z"
    }
   },
   "source": [
    "from mpl_toolkits.mplot3d import Axes3D\n",
    "\n",
    "import activation_function as act\n",
    "import numpy as np"
   ],
   "outputs": [],
   "execution_count": 4
  },
  {
   "metadata": {
    "ExecuteTime": {
     "end_time": "2025-11-11T09:18:43.601355Z",
     "start_time": "2025-11-11T09:18:43.582740Z"
    }
   },
   "cell_type": "code",
   "source": [
    "def init_network():\n",
    "    network={}\n",
    "    network['w1']=np.array([[0.1,0.3,0.5],[0.2,0.4,0.6]])\n",
    "    network['b1']=np.array([0.1,0.2,0.3])\n",
    "    network['w2']=np.array([[0.1,0.4],[0.2,0.5],[0.3,0.6]])\n",
    "    network['b2']=np.array([0.1,0.2])\n",
    "    network['w3']=np.array([[0.1,0.3],[0.2,0.4]])\n",
    "    network['b3']=np.array([0.1,0.2])\n",
    "    return network\n",
    "def forward(network,x):\n",
    "    W1,W2,W3 = network['w1'],network['w2'],network['w3']\n",
    "    b1,b2,b3= network['b1'],network['b2'],network['b3']\n",
    "\n",
    "    a1=np.dot(x,W1)+b1\n",
    "    z1=act.sigmoid(a1)\n",
    "    a2=np.dot(z1,W2)+b2\n",
    "    z2=act.sigmoid(a2)\n",
    "    a3=np.dot(z2,W3)+b3\n",
    "    Y=a3\n",
    "    return Y\n",
    "network=init_network()\n",
    "x=np.array([1.0,0.5])\n",
    "Y=forward(network,x)\n",
    "print(Y)\n"
   ],
   "id": "f8e8f3a2c1147a01",
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[0.31682708 0.69627909]\n"
     ]
    }
   ],
   "execution_count": 6
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
